﻿
Public Partial Class MainForm
	Public Sub New()
		' The Me.InitializeComponent call is required for Windows Forms designer support.
		Me.InitializeComponent()
		Me.LoadComponents()
		
	End Sub
	
	Public Function LoadComponents() as Boolean 
		' parse command line option
		' fill components value
		Dim fossil As New fossilCommand
		Dim currentDirectory As String 
		dim files as Collection
		
		currentDirectory = "D:\documents\projects\php\helpdesk"
		If fossil.changeDirectory(currentDirectory) = False Then
			Return False
		End If
		
		files = fossil.execChanges()
		Me.listView1_LoadFossilFileCollection(files)
		
		Return True
	End Function
	
	Public Function listView1_LoadFossilFileCollection(files As Collection) As Boolean
		
		Dim listItem As ListViewItem
		dim listSubItem as ListViewItem.ListViewSubItem
		
		Me.listView1.Items.Clear()
		
		For Each file In files
			listItem = Me.listView1.Items.Add(file.path)
			listSubItem = listItem.SubItems.Add(file.status)
		Next
		
		Return True
	End Function
End Class
